package org.al.poc.persistence.beans;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity(name="ORDRE") // sinon conflit avec keyword SQL "ORDER"... -_-
public class Order implements Serializable {

	/** Serializable **/
	private static final long serialVersionUID = 1L;
	
	
	@Id	
	@GeneratedValue(strategy=GenerationType.IDENTITY) 
	private Long orderId;
	
	private Integer clientId;
	
	private String action;
	
	private Integer qty;
	
	private Double price;
	
	private Long sessionId;
	
	@Enumerated(EnumType.ORDINAL)
	private OrderTypeEnum orderType;
	
	
	
	public Order() {}
	
	public Order(int clientId, String action, int qty, double price,
			long sessionId, OrderTypeEnum orderType) {
		this.clientId = clientId;
		this.action = action;
		this.qty = qty;
		this.price = price;
		this.sessionId = sessionId;
		this.orderType = orderType;
	}
	
	public Order(long orderId, int clientId, String action, int qty,
			double price, long sessionId, OrderTypeEnum orderType) {
		this.orderId = orderId;
		this.clientId = clientId;
		this.action = action;
		this.qty = qty;
		this.price = price;
		this.sessionId = sessionId;
		this.orderType = orderType;
	}

	
	
	
	public long getOrderId() {
		return orderId;
	}

	public void setOrderId(long orderId) {
		this.orderId = orderId;
	}

	public int getClientId() {
		return clientId;
	}

	public void setClientId(int clientId) {
		this.clientId = clientId;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public int getQty() {
		return qty;
	}

	public void setQty(int qty) {
		this.qty = qty;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public long getSessionId() {
		return sessionId;
	}

	public void setSessionId(long sessionId) {
		this.sessionId = sessionId;
	}

	public OrderTypeEnum getOrderType() {
		return orderType;
	}

	public void setOrderType(OrderTypeEnum orderType) {
		this.orderType = orderType;
	}
	
}
